<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\Resource;

class GiftResource extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        /** @var \App\Models\Gift $log */
        $log = $this;
        return [
            'id' => $log->id,
            'name' => $log->name,
            'money' => $log->money,
            'send' => $log->send,
            'total' => $log->total,
            'order_no' => $log->order_no,
            'created_at' => $log->created_at->toDateTimeString()
        ];
    }
}
